﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Transactions;

namespace conan.Data
{
    ///// <summary>
    ///// 事务语句统一执行
    ///// </summary>
    //public class DistributedTransactionExecute
    //{
   
    ///// <summary>
    ///// 事务语句统一执行
    ///// </summary>
    ///// <param name="ac">委托</param>
    ///// <returns></returns>
    //public static bool TransactionExecute(Action ac)
    //{
    //    try
    //    {
    //        using (TransactionScope ts = new TransactionScope())
    //        {
    //            ac.Invoke();
    //            ts.Complete();
    //        }
    //        return true;
    //    }
    //    catch
    //    {
    //        return false;
    //    }
    //}
    //}



    //public interface IDistributedTransaction : IDisposable
    //{
    //    void Complete();
    //}
    //public class DistributedTransaction : IDistributedTransaction
    //{
    //    private readonly TransactionScope _transactionScope;
    //    public DistributedTransaction()
    //    {
    //        _transactionScope = new TransactionScope();
    //    }

    //    public void Complete()
    //    {
    //        _transactionScope.Complete();
    //    }
    //    public void Dispose()
    //    {
    //        _transactionScope.Dispose();
    //    }
    //}

}
